﻿@namespace Core.Web.Admin.Blazor.Pages.User
@layout UserLayout
@page "/Authorize/login"

<div class="main__b__0">
    <div class="login">
        
        <Spin Spinning=loading >
        
        <Form Model="@_model" OnFinish="HandleSubmit">
            <Tabs DefaultActiveKey="1" @bind-ActiveKey="@context.LoginType" OnChange="OnTabChange">
                <TabPane Key="1" Tab="账户名登录">
                    <FormItem>
                        <AntDesign.Input Placeholder="请输入用户名/手机号" Size="large" @bind-Value="@context.UserName">
                            <Prefix><Icon Type="user" /></Prefix>
                        </AntDesign.Input>
                    </FormItem>
                    <FormItem>
                        <AntDesign.Input Placeholder="请输入密码" Size="large" @bind-Value="@context.Password" Type="password">
                            <Prefix><Icon Type="lock" /></Prefix>
                        </AntDesign.Input> 
                    </FormItem>
                </TabPane>
                <TabPane Key="2" Tab="邮箱登录">
                    <FormItem>
                        <AntDesign.Input Placeholder="请输入邮箱" Size="large" @bind-Value="@context.Emial">
                            <Prefix><Icon Type="mail" /></Prefix>
                        </AntDesign.Input>
                    </FormItem>
                    <FormItem>
                        <Row Gutter="8">
                            <AntDesign.Col Span="16">
                                <AntDesign.Input Placeholder="请输入验证码" Size="large" @bind-Value="@context.Captcha">
                                    <Prefix><Icon Type="mail" /></Prefix>
                                </AntDesign.Input>
                            </AntDesign.Col>
                            <AntDesign.Col Span="8">
                                <Button Size="large" Block OnClick="GetEmailCode">发送验证码</Button>
                            </AntDesign.Col>
                        </Row>
                    </FormItem>
                </TabPane>
            </Tabs>
            <div>
                <a style="float: right;">
                    Forgot Password
                </a>
            </div>
            <Button Type="primary" HtmlType="submit" Class="submit" Size="large" Block>Log in </Button>
            <div class="other">
                <a class="register" href="/Authorize/register">注册账户</a>
            </div>
        </Form>
         </Spin>
    </div>
</div>